<?php
$this->pageHeader = t('PAGE_TITLE', 'menuType');
$this->pageTitle = t('PAGE_TITLE', 'menuType');
$toolbar = new LGToolbar();
$toolbar->buttonAddNew('500', '320', t('PAGE_TITLE_ADDNEW', 'menuType'));
$toolbar->buttonDelete(t('BTN_DELETE'), t('BTN_DELETE'));
$toolbar->buttonRefresh(t('BTN_REFRESH'), t('BTN_REFRESH'), url(app()->controller->id . '/refresh'));
$this->pageToolbar = $toolbar->mergeToolbar();
$this->breadcrumbs = array(t('MENU_MANAGEMENT'), t('LBL_MENU_TYPE', 'menuType') => array('index'));
?>
<div id="ccontent">                                   
    <!-- search-form -->                                
    <div class="search-form"> 														
        <?php
        $this->renderPartial('_search', array(
            'model' => $model,
        ));
        ?>
    </div>
    <!-- grid -->
    <?php
    $dataProvider = $model->search();
    $this->widget('GridView', array(
        'id' => 'DataGrid',
        'dataProvider' => $dataProvider,
        'itemsCssClass' => 'grid',
	 'summaryText' => LGHelpers::getSummary(),
        'columns' => array(
            array(
                'header' => '#',
                'class' => 'CCheckBoxColumn',
                'selectableRows' => '2',
                'id' => 'chkId',
                'htmlOptions' => array('width' => '20px', 'align' => 'center'),
            ),
            array(
                'name' => 'name',
                'header' => t('LBL_NAME', 'menuType'),
                'value' => 'Html::link(CHtml::encode($data["name"]), $this->grid->controller->createUrl("menu/index",array("id" => $data->id)))',
                'type' => 'raw',
            ),
            array(
                'header' => t('LBL_DESCRIPTION', 'menuType'),
                'value' => 'CHtml::encode($data["description"])',
                'htmlOptions' => array('width' => '270px'),
                'type' => 'raw',
            ),
//            array(
//                'name' => 'status',
//                'header' => t('LBL_STATUS', 'menuType'),
//                'value' => 'Html::active($data["id"],$data["status"],"active")',
//                'htmlOptions' => array('width' => '20px', 'align' => 'center'),
//                'type' => 'raw',
//            ),            
            array(
                'name' => 'updated_by',
                'value' => 'CHtml::encode($data["updated_by"])',
                'header' => t('LBL_UPDATED_BY', 'menuType'),
                'htmlOptions' => array('width' => '120px', 'align' => 'center'),
                'type' => 'raw',
            ),
            array(
                'header' => t('LBL_UPDATE_DATE', 'menuType'),
                'htmlOptions' => array('width' => '120px', 'align' => 'center'),
                'type' => 'raw',
		'name' => 'update_date',
            ),
            array(
                'name' => 'id',
                'header' => t('LBL_ID', 'menuType'),
                'htmlOptions' => array('width' => '20px', 'align' => 'center'),
                'type' => 'raw',
            ),
            array('header' => t('LBL_ACTION', 'menuType'),
                'headerHtmlOptions' => array('width' => '10px', 'style' => 'text-align:center'),
                'class' => 'ButtonColumn',
                'buttons' => array(
                    'update' => array('title' => t('PAGE_TITLE_EDIT', 'menuType'), 'url' => 'Yii::app()->controller->createUrl("update",array("id"=>$data->id))', 'dialog-width' => '500', 'dialog-height' => '300'),
                )
            ),
        ),
    ));
    ?>